﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace INSTA.Exercices.Events
{
    public class SpeedChangedEventArgs : EventArgs
    {
        public SpeedChangedEventArgs()
        { }


        public SpeedChangedEventArgs(int previousSpeed, 
                                     int actualSpeed,
                                     int carHash)
        {
            ActualSpeed     = actualSpeed;
            PreviousSpeed   = previousSpeed;
            HashCode        = carHash;
        }

        /// <summary>
        /// Gets or sets the actual speed.
        /// </summary>
        public int ActualSpeed { get;  set;     }

        /// <summary>
        /// Gets or sets the previous speed.
        /// </summary>
        public int PreviousSpeed { get;  set;   }

        /// <summary>
        /// Gets the hash code.
        /// </summary>
        public int HashCode { get;  private set;        }

        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            var sb = new StringBuilder();

            string CRLF = "\r\n";

            


            sb.AppendFormat("Previous Speed : {0} ", PreviousSpeed);
            sb.Append(CRLF);
            sb.AppendFormat("Actual   Speed : {0} ", ActualSpeed);
            sb.Append(CRLF);
            sb.AppendFormat("HashCode       : {0} ", HashCode);
            sb.Append(CRLF);


            return sb.ToString();
        }

    }
}
